<?php
/******************DB相关*********************/
define('DB_DEV_SERVER',	false);
defined('DB_DEBUG') || define('DB_DEBUG', false);
//	数据超过记录开始反转
defined('REVERSE_NUM')       || define('REVERSE_NUM', 5000);
define('DB_ERROR_LOG',	false);
//	define('DB_ERROR_LOG_FILE',     "/opt/wwwroot/qun_inner/cache/sql_error_log/db_error.log");
//	捕获执行时间大于n秒的sql,只可短暂开启
define('CAPTURE_LONGSQL_TIME',          0); //捕获大于该秒数的sql语句，(>0 && DB_DEBUG===false时为开启)
//	define('CAPTURE_LONGSQL_LOG_FILE',      "/opt/wwwroot/qun_inner/cache/sql_error_log/");

define('DB_RET_RES',        'RES');
define('DB_RET_ROW',        'ROW');
define('DB_RET_ROWS',       'ROWS');
define('DB_RET_VALUE',      'VALUE');
define('DB_RET_ROWS_PAGE',  'ROWS_PAGE');

define('DB_DEFAULT_PAGE_SIZE', 24);

/********************data source ************************************/
function &get_data_source($const_db, $param = null, $need_hash = true) 
{

    $hash				= ($param && $need_hash) ? md5($param) : null;
    $user				= null;
    $pass				= null;
    $port				= null;
    $table				= null;
    $table_alias	= null;

 /********************************************************************/
    switch ($const_db)
    {	
		case 'auction_prize':
		case 'auction_giftlog':
		case 'auction_userinfo':
			$host			= '10.21.2.190';
			$user			= 'dmz';
            $pass			= 'dmz8PHtvbRZoEZdS';
            $database	= 'dmz_act_basic';
            $table			= $const_db;
            break;
        default :
            $ret	= array();
            return $ret;
    }

 /********************************************************************/

    $ret = array(   
    		'host'				=> $host.($port ? ":{$port}" : ''),
			'user'				=> is_null($user) ? "root" : $user,
			'pass'          	=> is_null($pass) ? "" : $pass,
			'database'      => $database,
			'table'         		=> $table,
			'table_alias'	=> $table_alias
	);
    return $ret;
}
### end data source ###########################################################
?>
